<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>登录</title>
		<link rel="stylesheet" href="__PUBLIC__/BeginnerAdmin/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="__PUBLIC__/BeginnerAdmin/css/login.css" />
	</head>

	<body class="beg-login-bg">
		<div class="beg-login-box">
			<header>
				<h1>后台登录</h1>
			</header>
			<div class="beg-login-main">
				<form action="admin_login_loginverify.html" class="layui-form" method="post">
					<div class="layui-form-item">
						<label class="beg-login-icon">
                        <i class="layui-icon">&#xe612;</i>
                    </label>
						<input type="text" name="mobile" id="mobile" lay-verify="mobile" autocomplete="off" placeholder="这里输入登录名" class="layui-input">
					</div>
					<div class="layui-form-item">
						<label class="beg-login-icon">
                        <i class="layui-icon">&#xe642;</i>
                    </label>
						<input type="password" name="password" id="password" lay-verify="password" autocomplete="off" placeholder="这里输入密码" class="layui-input">
					</div>
					<div class="layui-form-item">
						<label class="beg-login-icon">
							<i class="layui-icon">&#xe642;</i>
						</label>
						<input type="text" name="verify" id="verify" lay-verify="verify" autocomplete="off" placeholder="这里输入下面的验证码" class="layui-input">
					</div>
					<div class="layui-form-item">
						<img id="verify_src" style="width: 100%" onclick="verify_f5();" src="admin_login_Verify.html">
					</div>

					<div class="layui-form-item">
						<div class="beg-pull-left beg-login-remember">
							<label>记住帐号？</label>
							<input type="checkbox" name="rememberme" id="rememberme" value="true" lay-skin="switch" checked title="记住帐号">
						</div>
						<div class="beg-pull-right">
							<button class="layui-btn layui-btn-primary" lay-submit lay-filter="login">
                            <i class="layui-icon">&#xe650;</i> 登录
                        </button>
						</div>
						<div class="beg-clear"></div>
					</div>
				</form>
			</div>
			<footer>
				<p>极地梦想信息技术 © 版权所有</p>
			</footer>
		</div>
		<script src="__PUBLIC__/AmazeUI/assets/js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/BeginnerAdmin/plugins/layui/layui.js"></script>

		<script>
            function verify_f5() {
                $("#verify_src").attr('src','admin_login_Verify.html?r='+Math.random());
            }

            layui.use(['layer', 'form'], function() {
                var layer = layui.layer,
                    $ = layui.jquery,
                    form = layui.form;
                //layer.alert("登录失败！<br>请填写正确的验证码！");
                form.on('submit(login)',function(data){
                    $.post('admin_login_loginverify.html',
						{mobile:$("#mobile").val(),password:$("#password").val(),verify:$("#verify").val(),rememberme:$("#rememberme").is(":checked")?1:0},
						function (date) {
                        if(date.code != 200){
                            layer.alert(date.msg);
                            //$("#verify_src").attr('src','admin_login_Verify.html?r='+Math.random());
                            verify_f5();
						}else{
                            window.location = 'admin_index.html';
                        }
                    },'json');
                    return false;
                });
            });
		</script>
	</body>

</html>